<?php
use Illuminate\Support\Facades\Route;
use \App\Http\Controllers\background\{BrandController,MechantController,OrderbillController,ProfitController,MechantProfitController,LinkCarmiController,InterfaceController,BalanceController,AccountController,ImportInfoController,InvoiceController,MerchantApiController};
use \App\Http\Controllers\merchant\{MerchantOrderController,MerchantInvoiceController};
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
// 品牌分类接口
Route::prefix('Test')->group(function () {
    Route::any('testexcel',[BrandController::class,'excelinfo']); //品牌列表
});
// 品牌分类接口
Route::prefix('Brand')->middleware("auth:support")->group(function () {
    Route::post('brandlist',[BrandController::class,'brandlist']); //品牌列表
    Route::post('addbrandinfo',[BrandController::class,'addbrandinfo']); // 添加品牌
    Route::post('branddel',[BrandController::class,'branddel']); // 删除品牌
    Route::post('getsuppbrand',[BrandController::class,'getsuppbrand']); // 二级品牌分类
    Route::post('gettopbrand',[BrandController::class,'gettopbrand']); // 上级分类
    Route::post('editbrand',[BrandController::class,'editbrand']); // 编辑分类
    Route::post('brandLevelList',[BrandController::class,'brandLevelList']); //品牌列表分级
});
//商户接口
Route::prefix('Mechant')->middleware("auth:support")->group(function () {
    Route::post('mechantlist',[MechantController::class,'mechantlist']); // 商户列表
    Route::post('mecahntrecharge',[MechantController::class,'rechargeMoney']); // 商户加款
    Route::post('cutMoney',[MechantController::class,'cutMoney']); // 商户扣款
    Route::post('mechantopen',[MechantController::class,'mechantopen']); // 商户开关
    Route::post('iplist',[MechantController::class,'iplist']); // ip白名单
    Route::post('ipaddinfo',[MechantController::class,'ipaddinfo']); // ip白名单添加
    Route::post('ipdelinfo',[MechantController::class,'ipdelinfo']); // ip白名单删除
    Route::post('identifyInfo',[MechantController::class,'identifyInfo']); // 商户认证审核列表
    Route::post('mecahntexam',[MechantController::class,'mecahntexam']); // 商户审核
    Route::post('addFunds',[MechantController::class,'addFunds']); // 商户h5加款接口
});

// 账单订单接口
Route::prefix('Orderbill')->middleware("auth:support")->group(function () {
    Route::post('orderbilllist',[OrderbillController::class,'orderbilllist']); // 商户交易订单/开票
    Route::post('mechantOrder',[OrderbillController::class,'mechantOrder']); // 商户订单/开票
    Route::post('getsummoney',[OrderbillController::class,'getsummoney']); // 商户交易订单获取总金额
    Route::post('orderbilldetail',[OrderbillController::class,'orderbilldetail']); // 商户交易订单查看详情
    Route::post('rechargebill',[OrderbillController::class,'rechargebill']); // 加款记录
    Route::post('setfundstype',[OrderbillController::class,'setfundstype']); // 修改加款类型
    Route::post('setremarks',[OrderbillController::class,'setremarks']); // 修改备注
    Route::post('checkbill',[OrderbillController::class,'checkbill']); // 核对加款
    Route::post('cutbill',[OrderbillController::class,'cutbill']); // 扣款记录
    Route::post('accountbill',[OrderbillController::class,'accountbill']); // 账户明细
    Route::post('daycensus',[OrderbillController::class,'daycensus']); // 日汇总
    Route::post('monthcensus',[OrderbillController::class,'monthcensus']); // 月汇总
    Route::post('gettime',[OrderbillController::class,'gettime']); // 时间
    Route::post('goodsName',[OrderbillController::class,'goodsName']); // 订单获取商品名称
    Route::post('goodsVital',[OrderbillController::class,'goodsVital']); // 商品归属统计
    Route::post('cycleVital',[OrderbillController::class,'cycleVital']); // 循环充归属统计
});

// 接口服务费接口
Route::prefix('Profit')->middleware("auth:support")->group(function () {
    Route::post('profitlist',[ProfitController::class,'profitlist']); // 总计服务费列表
    Route::post('profitlistdetail',[ProfitController::class,'profitlistdetail']); // 总计服务费列表查看详情
    Route::post('profitdetailed',[ProfitController::class,'profitdetailed']); // 总计服务费列表查看明细
    Route::post('getsummoney',[ProfitController::class,'getsummoney']); // 服务费统计
});

// 商户服务费接口
Route::prefix('MechantProfit')->middleware("auth:support")->group(function () {
    Route::post('dayprofit',[MechantProfitController::class,'profitlist']); // 日服务费列表
    Route::post('monthprofit',[MechantProfitController::class,'monthprofitlist']); // 月服务费列表
    Route::post('monthprofitdetail',[MechantProfitController::class,'monthprofitdetail']); // 月服务费详情
    Route::post('dayprofitdetail',[MechantProfitController::class,'dayprofitdetail']); // 日服务费详情
    Route::post('allprofit',[MechantProfitController::class,'allprofit']); // 服务费利润总和
    Route::post('timeprofit',[MechantProfitController::class,'timeprofit']); // 时间段内服务费利润总和
    Route::post('years',[MechantProfitController::class,'years']); // 获取年份
    Route::post('months',[MechantProfitController::class,'months']); // 获取月份
});

// 卡密链接接口
Route::prefix('CarmiLink')->middleware("auth:support")->group(function () {
    Route::post('carmiinsert',[LinkCarmiController::class,'carmiinsert']); // 添加卡密链接接口
    Route::post('elsenum',[LinkCarmiController::class,'elsenum']); // 剩余库存
    Route::post('carmilinklist',[LinkCarmiController::class,'carmilinklist']); // 卡密链接列表
    Route::post('carmilinkdel',[LinkCarmiController::class,'carmilinkdel']); // 卡密单个删除
    Route::post('carmilinkdelmany',[LinkCarmiController::class,'carmilinkdelmany']); // 卡密批量删除
    Route::post('kamitopsals',[LinkCarmiController::class,'kamitopsals']); // 卡密优先出售
    Route::post('emptycarmi',[LinkCarmiController::class,'emptycarmi']); // 一键清空卡密
    Route::post('usemany',[LinkCarmiController::class,'usemany']); // 批量已使用
    Route::post('repeatcarmi',[LinkCarmiController::class,'repeatcarmi']); // 重复卡密
    Route::post('abnormalcarmi',[LinkCarmiController::class,'abnormalcarmi']); // 异常卡密
});

// 接口接口
Route::prefix('interface')->middleware("auth:support")->group(function () {
    Route::post('Interfacelist',[InterfaceController::class,'Interfacelist']); // 接口设置列表
    Route::post('interfaceset',[InterfaceController::class,'interfaceset']); // 接口设置
    Route::post('interfacebalance',[InterfaceController::class,'interfacebalance']); // 接口余额
    Route::post('interfacedetail',[InterfaceController::class,'interfacedetail']); // 接口详情
    Route::post('CamiCate',[InterfaceController::class,'CamiCate']); // 卡密类型
    Route::post('CamiCateStatus',[InterfaceController::class,'CamiCateStatus']); // 卡密类型开关
    Route::post('getCateInfo',[InterfaceController::class,'getCateInfo']); // 卡密分类
});

// 余额信息
Route::prefix('Supplier')->middleware("auth:support")->group(function () {
    Route::post('Balance',[BalanceController::class,'Balance']); // 账户余额
});

// 账户接口
Route::prefix('Account')->middleware("auth:support")->group(function () {
    Route::post('accountinfo',[AccountController::class,'accountinfo']); // 账户信息
    Route::post('uploadlogo',[AccountController::class,'uploadlogo']); // 上传logo
    Route::post('accountbal',[AccountController::class,'accountbal']); // 平台使用费
    Route::post('accountbill',[AccountController::class,'accountbill']); // 平台费用使用明细
    Route::post('balancebill',[AccountController::class,'balancebill']); // 账户余额明细
    Route::post('balancewarn',[AccountController::class,'balancewarn']); // 平台费用时效提醒
    Route::post('fitbalancewarn',[AccountController::class,'fitbalancewarn']); // 平台费用时效提醒设置
    Route::post('supplierbalancewarn',[AccountController::class,'supplierbalancewarn']); // 平台余额提醒
});

// 商户订单统计
Route::prefix('MechantOrder')->middleware("auth:merchant")->group(function () {
    Route::post('getordervital',[MerchantOrderController::class,'getordervital']); // 订单统计
    Route::post('getBillVital',[MerchantOrderController::class,'getBillVital']); // 报表统计
    Route::post('getBillVitalDownload',[MerchantOrderController::class,'getBillVitalDownload']); // 报表下载
});
// 商户订单统计
Route::prefix('MechantBrand')->middleware("auth:merchant")->group(function () {
    Route::post('getMertBrandinfo',[BrandController::class,'getMertBrandinfo']); // 商户品牌分类
});
// 商户开票信息
Route::prefix('MechantInvoice')->middleware("auth:merchant")->group(function () {
    Route::post('invoicingslist',[MerchantInvoiceController::class,'invoicingslist']); // 商户获取开票信息数据
    Route::post('addinvoicings',[MerchantInvoiceController::class,'addinvoicings']); // 商户提交发票数据
    Route::post('invoicingsrecordlist',[MerchantInvoiceController::class,'invoicingsrecordlist']); //  开票记录获取
    Route::post('invoicingsorderlist',[MerchantInvoiceController::class,'invoicingsorderlist']); // 开票订单信息获取
    Route::post('getcontentorder',[MerchantInvoiceController::class,'getcontentorder']); //开票订单信息统计数据
    Route::post('caninvoicingorderinfo',[MerchantInvoiceController::class,'caninvoicingorderinfo']); //可开票订单数据获取
    Route::post('invoicingorders',[MerchantInvoiceController::class,'invoicingorders']); // 订单开发票
});
// 商户查询余额记录
Route::prefix('MechantBalance')->middleware("auth:merchant")->group(function () {
    Route::post('ZeroBalance',[MechantController::class,'ZeroBalance']); // 商户查询零点余额
});

// 导出接口
Route::prefix('Import')->middleware("auth:support")->group(function () {
    Route::post('accountBill',[ImportInfoController::class,'accountBill']); // 账单导出
    Route::post('balanceBillImport',[ImportInfoController::class,'balanceBill']); // 余额明细导出
    Route::post('merchantListImport',[ImportInfoController::class,'mechantlist']); // 商户列表导出
    Route::post('orderBillListImport',[ImportInfoController::class,'orderBillList']); // 商户交易订单/开票导出
    Route::post('profitListImport',[ImportInfoController::class,'profitlist']); // 日服务费列表
    Route::post('profitDetailedImport',[ImportInfoController::class,'profitdetailed']); // 总计服务费列表查看明细导出
    Route::post('interfaceDetailImport',[ImportInfoController::class,'interfacedetail']); // 接口详情导出
    Route::post('dayProfitImport',[ImportInfoController::class,'dayProfit']); // 日服务费导出
    Route::post('monthProfitListImport',[ImportInfoController::class,'monthprofitlist']); // 月服务费导出
    Route::post('dayProfitDetailImport',[ImportInfoController::class,'dayprofitdetail']); // 日服务费详情导出
    Route::post('mechantOrderImport',[ImportInfoController::class,'mechantOrder']); // 订单列表导出
});

// 后台获取开票信息进行审核
Route::prefix('PlatformInvoice')->middleware("auth:support")->group(function () {
    Route::post('examineList',[InvoiceController::class,'examineList']); // 账户信息
    Route::post('examine',[InvoiceController::class,'examine']); // 开票审核
    Route::post('InvoiceOrderList',[InvoiceController::class,'InvoiceOrderList']); // 开票订单详情
    Route::post('InvoiceMoney',[InvoiceController::class,'InvoiceMoney']); // 开票订单金额
});

// 商户接口
Route::controller(MerchantApiController::class)->group(function () {
    Route::post('balanceApi', "balance");//商户余额接口
    Route::post('goodsApi', "goods");//商品接口
    Route::post('orderApi', "order");//查单接口

});
Route::post('test111',[MerchantApiController::class,'test']); // 测试接口
